package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.RadiusTarget;
import com.genexususa.eo.bing.CampaignManagementServiceClasses.RadiusTargetBid;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class GxRadiusTarget extends RadiusTarget {
    public GxRadiusTarget(Element element) {
        NodeList bidsNode = element.getElementsByTagName("RadiusTargetBidCollection");
        if (bidsNode.getLength() > 0) {
            NodeList radiusTargetBidNode = ((Element)bidsNode.item(0)).getElementsByTagName("RadiusTargetBid");
            RadiusTargetBid[] radiusTargetBids = new RadiusTargetBid[radiusTargetBidNode.getLength()];
            for (int temp = 0; temp < radiusTargetBidNode.getLength(); temp++) {
                radiusTargetBids[temp] = new GxRadiusTargetBid((Element)radiusTargetBidNode.item(temp));
            }
            this.setBids(radiusTargetBids);
        }
    }
}
